# Maintainer: @naveen521kk on Github, Naveen M K <naveen521kk@gmail.com>

_perlname=Win32-Shortcut
_realname="${_perlname,,}"
pkgbase=mingw-w64-perl-${_realname}
pkgname=("${MINGW_PACKAGE_PREFIX}-perl-${_realname}")
pkgver=0.08
pkgrel=5
pkgdesc="Perl Module to deal with Windows Shortcuts (mingw-w64)"
arch=('any')
mingw_arch=('mingw64' 'ucrt64' 'clang64' 'clangarm64')
url="https://metacpan.org/dist/Win32-Shortcut"
msys2_repository_url="https://github.com/jandubois/win32-shortcut"
license=('spdx:Artistic-1.0-Perl OR GPL-1.0-or-later')
groups=("${MINGW_PACKAGE_PREFIX}-perl-modules")
depends=("${MINGW_PACKAGE_PREFIX}-perl")
makedepends=("${MINGW_PACKAGE_PREFIX}-gcc"
             "${MINGW_PACKAGE_PREFIX}-python"
             "${MINGW_PACKAGE_PREFIX}-make")
options=('!emptydirs')
source=("https://cpan.metacpan.org/authors/id/J/JD/JDB/${_perlname}-${pkgver}.tar.gz"
        "patchmakefile.py")
sha256sums=('b4557ecf8003402ec118c2c149bbd7d0ad6b2e30ab65e6ca88ad0b794a5a4544'
            '9b3a852cfb38c05aaea3a6dff4625b038c1d889ed99bb292d8b73e4fb83ff676')

build() {
  cd "$srcdir/${_perlname}-${pkgver}"
  PERL_MM_USE_DEFAULT=1 perl Makefile.PL
  export pkgdir=$pkgdir
  python $srcdir/patchmakefile.py
  mingw32-make
}

package() {
  cd "$srcdir/${_perlname}-${pkgver}"
  mingw32-make DESTDIR="${pkgdir}/" install
}
